package com.foxsteps.gsonformat.tools;

import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

public class JsonParserFactory {
    private static JsonParserFactory jsonParserFactory = null;
    private JsonParserFactory() {
    }
    private static Object lockObj = new Object();
    public static JsonParserFactory getInstance() {
        if(Objects.nonNull(jsonParserFactory)) {
            return jsonParserFactory;
        }
        synchronized (lockObj) {
            if(Objects.isNull(jsonParserFactory)) {
                jsonParserFactory = new JsonParserFactory();
            }
        }
        return jsonParserFactory;
    }

    public CjgJsonParser getJsonParser(String parserNanme){
        if(StringUtils.isEmpty(parserNanme)) {
            return new DefaultJsonParser();
        }
        return null;
    }
}
